//	--------------------------------------------------------------------
//	Copyright(C) 2006,2007 Zhao Yukun. All rights reserved.
//	This file is a part of the Xeres system.
//	Xeres 2007
//	Contact : xeres.engine@gmail.com
//	$(reservedInfo)
//	$(reservedDeclaration)
//	--------------------------------------------------------------------
///	@file	<CWindowEvent.h>
///	@path	~/src/engine/xcore/
///	@date	2007/12/12
///	@desc	.

#pragma once

#include "xeres.h"

#include "lib/math/rect.h"

#include "engine/runtime/IEvent.h"

namespace xeres {

	enum WindowEventTag
	{
		// no
		WINDOW_EVENT_NONE ,
		// for activate event
		WINDOW_EVENT_ACTIVATE ,
		WINDOW_EVENT_INACTIVATE ,
		// size event
		WINDOW_EVENT_ENTERSIZING ,
		WINDOW_EVENT_EXITSIZING ,
		WINDOW_EVENT_MINIMIZED ,
		// paint event
		/**/
		WINDOW_EVENT_last
	};

	// for event subscriber
	struct WindowEventInfo
	{
		// general tag
		WindowEventTag		m_tag;
		// window rectangle
		Rect<int>			m_rect;
	};

	/*!
		\class	CWindowEvent
		\brief
	*/
	class CWindowEvent : public IEvent
	{
	public:

		/// \ctor
		CWindowEvent( void );

		/// \dtor
		virtual ~CWindowEvent( void );

		DECL_IOBJECT_CLASS( CWindowEvent , IEvent );

	public:
		
	//@ interface

		/*!
			\brief		Active event.
		*/
		virtual void Active( void * eventParam );

		/*!
			\brief		Called when the event is not handled.
		*/
		virtual void OnUnhandled( void * eventParam );

	private:

	//@ data
	};

} // namespace xeres
